<template>
    <page-body>
        <view class="page">
            <view class="flex flex-direction align-stretch benben-position-layout flex restaurant_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex align-center justify-between flex-sub restaurant_fd0_0'>
                    <view class='flex flex-wrap align-center restaurant_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  restaurant_fd0_0_c0_c0'>&#xe794;</text>
                    </view>
                    <text class='restaurant_fd0_0_c1'>校内餐饮</text>
                    <view class='flex flex-wrap align-center restaurant_fd0_0_c2'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex flex-wrap align-center justify-center benben-flex-layout restaurant_flex_1">
                <view style="position: relative">
                    <swiper ref="benbenSwiperfd1_0" @change="bannerIndexfd1_0 = $event.detail.current" class='flex position-relative restaurant_fd1_0' previous-margin="0rpx" next-margin="0rpx" :display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>

                        <template v-for='(item,key0) in list1'>
                            <swiper-item class='flex  restaurant_fd1_0' :key='key0'>
                                <image class='restaurant_fd1_0' mode="aspectFill" :src='item.thumb' @tap.stop="dynamicJump(item.href)"></image>
                            </swiper-item>
                        </template>

                    </swiper>
                </view>
            </view>

            <!---flex布局flex布局结束-->
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout restaurant_flex_2">
                <view class='flex flex-wrap align-center justify-between restaurant_fd2_0'>
                    <template v-for='(item,key0) in list2'>
                        <view class='flex flex-direction flex-wrap align-stretch restaurant_fd2_0_c0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/inSchool/ctshopList/ctshopList?aid=${item.aid}`"  :key='key0'>
                            <image class='restaurant_fd2_0_c0_c0' mode="aspectFill" :src='item.thumb'></image>
                            <view class='flex flex-wrap align-center self-center restaurant_fd2_0_c0_c1'>
                                <image class='restaurant_fd2_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"28.png"'></image>
                                <text class='flex-sub restaurant_fd2_0_c0_c1_c1'>{{item.name}}</text>
                            </view>
                        </view>
                    </template>

                </view>
            </view>

            <!---flex布局flex布局结束-->


        </view>
    </page-body>
</template>
<script>
    import {
        validate
    } from '@/common/utils/validate.js'

    export default {
        components: {},


        data() {
            return {
                "bannerIndexfd1_0": 0,
                "list2": [],
                "list1": [],
				xuexiao:{
					aid:''
				}
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {
			if (uni.getStorageSync('schooLinfo')) {
				console.log(uni.getStorageSync('schooLinfo'))
				this.xuexiao = JSON.parse(uni.getStorageSync('schooLinfo'))
			}
            this.getfd66f9c64be345Func()
            this.getaj36e02b419726Func()
        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {

        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
            //首页=》查询餐厅管理
            async getfd66f9c64be345Func() {
                //请求方法
                //数据验证

                let datalist2 = await this.$api.get(global.apiUrls.post666f9c64be345, {
                    school_id: this.xuexiao.aid
                });

                if (datalist2.data.code != 1) {
                    this.$message.info(datalist2.data.msg);
                    return
                }
                let infolist2 = datalist2.data;
                this.list2 = infolist2.data

            },
            //广告-广告列表
            async getaj36e02b419726Func() {
                //请求方法
                //数据验证

                let datalist1 = await this.$api.get(global.apiUrls.post641e624160dd0, {
                    operationadstype_id: '2'
                });

                if (datalist1.data.code != 1) {
                    this.$message.info(datalist1.data.msg);
                    return
                }
                let infolist1 = datalist1.data;
                this.list1 = infolist1.data

            }
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: url(image-path('190.png')) no-repeat;
        background-size: 100% auto;
    }

    .restaurant_flex_0 {
        // border-bottom: 1px solid #eee;
        background: url(image-path('190.png')) no-repeat;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .restaurant_fd0_0_c2 {
        height: 88rpx;
        width: 120rpx;
    }

    .restaurant_fd0_0_c1 {
        font-size: 32rpx;
        font-weight: 700;
        color: #fff;
        line-height: 45rpx;
    }

    .restaurant_fd0_0_c0_c0 {
        font-size: 36rpx;
        color: #fff;
    }

    .restaurant_fd0_0_c0 {
        width: 120rpx;
        height: 88rpx;
    }

    .restaurant_fd0_0 {
        height: 88rpx;
        padding: 20rpx 32rpx 20rpx 32rpx;
    }

    .restaurant_flex_1 {
        margin: 12rpx 0rpx 32rpx 0rpx;
    }

    .restaurant_numberfd1_0_c0 {
        background: #525050;
        position: absolute;
        bottom: 20rpx;
        right: 30rpx;
        width: 80rpx;
        height: 40rpx;
        border-radius: 6rpx 6rpx 6rpx 6rpx;
        font-size: 24rpx;
        color: #FFFFFF;
        line-height: 46rpx;
        font-weight: 400;
    }

    .restaurant_fd1_0 {
        width: 686rpx;
        height: 324rpx;
        border-radius: 24rpx;
    }

    .restaurant_swiperDotUnselectedfd1_0 {
        border: 1px solid rgba(0, 0, 0, 0.3);
        background: rgba(0, 0, 0, 0.3);
        width: 16rpx;
        height: 16rpx;
        border-radius: 100rpx 100rpx 100rpx 100rpx;
        margin: 0rpx 6rpx 0rpx 0rpx;
        font-size: 24rpx;
        color: #fff;
    }

    .restaurant_swiperDotSelectedfd1_0 {
        border: 1px solid #00A7FF;
        background: #00A7FF;
        width: 16rpx;
        height: 16rpx;
        border-radius: 100rpx 100rpx 100rpx 100rpx;
        margin: 0rpx 6rpx 0rpx 0rpx;
        font-size: 24rpx;
        color: #fff;
    }

    ::v-deep .restaurant_swiperDotfd1_0 {
        position: absolute;
        bottom: 20rpx;
        left: 0rpx;
        right: 0rpx;
    }

    .restaurant_flex_2 {
        background: rgba(248, 248, 248, 1);
        background-size: 100% auto;
        border-radius: 32rpx 32rpx 0rpx 0rpx;
    }

    .restaurant_fd2_0_c0_c1_c1 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 400;
        line-height: 45rpx;
        -webkit-line-clamp: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    .restaurant_fd2_0_c0_c1_c0 {
        width: 32rpx;
        height: 32rpx;
        margin: 0rpx 16rpx 0rpx 0rpx;
    }

    .restaurant_fd2_0_c0_c1 {
        margin: 24rpx 0rpx 24rpx 0rpx;
    }

    .restaurant_fd2_0_c0_c0 {
        width: 333rpx;
        height: 220rpx;
        border-radius: 16rpx;
    }

    .restaurant_fd2_0_c0 {
        width: 333rpx;
        border-radius: 16rpx;
        margin: 0rpx 0rpx 0rpx 0rpx;
    }

    .restaurant_fd2_0 {
        padding: 32rpx 32rpx 0rpx 32rpx;
    }
</style>